<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        var n = prompt("输入一个整数。")
        console.log(yinshu())
        function yinshu(){
            var sum = 0;
            var arr = []
            for(var i = 1;i<n;i++){
                for(var j = 1;j<=i;j++){
                    if(i%j == 0&&j!=1&&i!=j){
                        break;
                    }
                    if(i==j&&i!=1){
                        sum++
                        arr.push(i)
                    }
                }   
           }
           return (arr+"共"+sum+"个!!")

       }
    </script>
</body>
</html>